import { app, BrowserWindow } from "electron";
let mainWindow;

function createWindow() {
  mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
  });

  // Electron 加载 Vite 开发服务器
  mainWindow.loadURL("http://192.168.31.8:3230/"); // 默认 Vite 开发服务器端口

  mainWindow.on("closed", () => {
    mainWindow = null;
  });
}

app.on("ready", createWindow);

app.on("window-all-closed", () => {
  if (process.platform !== "darwin") {
    app.quit();
  }
});
